
[dbo].[AddressPurposeContactType]
CREATE TABLE [dbo].[AddressPurposeContactType]
(
[AddressPurposeContactTypeKey] [uniqueidentifier] NOT NULL,
[AddressPurposeKey] [uniqueidentifier] NOT NULL,
[ContactTypeKey] [uniqueidentifier] NOT NULL,
[IsSingleUse] [bit] NOT NULL,
[DisplayOrder] [smallint] NOT NULL,
[IsAddressRequired] [bit] NOT NULL,
[IsPhoneRequired] [bit] NOT NULL,
[IsFaxRequired] [bit] NOT NULL,
[IsEmailRequired] [bit] NOT NULL,
[AlwaysDisplayFlag] [bit] NOT NULL CONSTRAINT [DF_AddressPurposeContactType_AlwaysDisplayFlag] DEFAULT ((0)),
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressPurposeContactType] ADD CONSTRAINT [PK_AddressPurposeContactType] PRIMARY KEY CLUSTERED ([AddressPurposeContactTypeKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressPurposeContactType] ADD CONSTRAINT [AK_AddressPurposeContactType] UNIQUE NONCLUSTERED ([AddressPurposeKey], [ContactTypeKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressPurposeContactType] ADD CONSTRAINT [FK_AddressPurposeContactType_AddressPurposeRef] FOREIGN KEY ([AddressPurposeKey]) REFERENCES [dbo].[AddressPurposeRef] ([AddressPurposeKey])
GO
ALTER TABLE [dbo].[AddressPurposeContactType] ADD CONSTRAINT [FK_AddressPurposeContactType_ContactTypeRef] FOREIGN KEY ([ContactTypeKey]) REFERENCES [dbo].[ContactTypeRef] ([ContactTypeKey])
GO